<article class="width_full module"> 
<header>
	<h3 class="tabs_involved">Manage News
	<input type='submit' value='Delete' style='margin:5px;float:right;' onclick='$("#form").submit();'/>
	<input type='submit' value='Add' style='margin:5px;float:right;' onclick='window.location="<?php echo base_url('/index.php/admin/news/add');?>"'/>
	</h3>
</header>

<form action="<?php echo base_url('/index.php/admin/news/delete');?>" method="post" enctype="multipart/form-data" id="form">
<div class="tab_container">
	<div id="tab1" class="tab_content">
		<table class="tablesorter" cellspacing="0">
			<thead>
				<tr>
					<th><input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);" /></th>
					<th>ID</th>
					<th>Title</th>
					<th>Company Name</th>
					<th>Time</th>
					<th>Actions</th>
				</tr>
			</thead>
			<tbody>
				<?php if (isset($list)) foreach ($list as $item){?>
				<tr>
					<td><input type="checkbox" name="selected[]" value="<?php echo $item->id;?>"/></td>
					<td><?php echo $item->id;?></td>
					<td><?php echo $item->title;?></td>
					<td><?php echo ($item->companyid)?$item->name:'General news';?></td>
					<td><?php echo date('Y-m-d',strtotime($item->time));?></td>
					<td>
						<input type="image" onclick="window.location='<?php echo site_url($route2link.'/edit/'.$item->id);?>';return false;" src="<?php echo site_url();?>images/icn_edit.png" title="Edit">
					</td>
				</tr>
				<?php }?>
			</tbody>
		</table>
	</div>
	<!-- end of #tab1 -->
</div><!-- end of .tab_container --> 
</form>
</article><!-- end of content manager article -->
<script type="text/javascript">
	$(document).ready(function(){ 
		$(".tablesorter").tablesorter({headers:{0:{sorter:false},5:{sorter:false}}}); 
	});
</script>